package oracle.springbootxm.controller;

import oracle.springbootxm.pojo.GoodsInfo;
import oracle.springbootxm.pojo.MenuInfo;
import oracle.springbootxm.service.GoodsService;
import oracle.springbootxm.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MenuController {
    @Autowired
    MenuService menuService;

    @RequestMapping("/initmenu")
    public String initMenu(Model model) {
        MenuInfo root = menuService.queryMenuInfo();
        model.addAttribute("menuInfo", root);
        return "index";
    }
}
